package be.novelfaces.showcase;

import java.text.DecimalFormatSymbols;
import java.util.Locale;

import javax.faces.bean.ManagedBean;
import javax.faces.context.FacesContext;

@ManagedBean
public class NumpadDecimalSeparatorManagedBean {
	
	public String getLocale() {
		return FacesContext.getCurrentInstance().getViewRoot().getLocale()
				.getLanguage();
	}

	public void setLocale(String locale) {
		FacesContext.getCurrentInstance().getViewRoot()
				.setLocale(new Locale(locale));
	}

	public String getSeparator() {
		return String.valueOf(DecimalFormatSymbols.getInstance(
				FacesContext.getCurrentInstance().getViewRoot().getLocale())
				.getDecimalSeparator());
	}
	
	public String getCommaSeparator() {
		return ",";
	}
	
}
